package com.hbnu.system.controller;

import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.Project_Qualification;
import com.hbnu.system.service.IProjectQualificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/projectqulification")
@Api(tags = "项目量化模块")
public class ProjectQualificationController {
    @Autowired
    private IProjectQualificationService iProjectQualificationService;

    @ApiOperation("项目量化添加")
    @PostMapping("/addProjectQulification")
    public Rest<Boolean> addProjectQulification(@RequestBody Project_Qualification project_qualification){
        boolean add = iProjectQualificationService.addProject_Qualification(project_qualification);
        return add ? Rest.success() : Rest.failed();
    }

    @ApiOperation("项目量化删除")
    @GetMapping("/deleteProjectQulification")
    public Rest<Boolean> deleteProjectQulification(String ID){
        boolean delete = iProjectQualificationService.deleteProject_Qualification(ID);
        return delete ? Rest.success() : Rest.failed();
    }

    @ApiOperation("项目量化查看")
    @GetMapping("/getProjectQulification")
    public Rest<List<Project_Qualification>> getProjectQulification(String ProjectID){
        List<Project_Qualification> oneProject_qualification = iProjectQualificationService.getOneProject_Qualification(ProjectID);

        return Rest.success(oneProject_qualification);
    }
}
